package view;



import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JSeparator;
import javax.swing.SpringLayout;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.SwingConstants;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JTextField;

/*
 *  GUI
 */
public class Site_engg extends JFrame{
	private JTable table;
	private JTextField textField;
	private JTable table_1;
	public Site_engg() {
		SpringLayout springLayout = new SpringLayout();
		getContentPane().setLayout(springLayout);
		
		JSeparator separator = new JSeparator();
		springLayout.putConstraint(SpringLayout.NORTH, separator, -35, SpringLayout.SOUTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, separator, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator, -33, SpringLayout.SOUTH, getContentPane());
		getContentPane().add(separator);
		
		JSeparator separator_1 = new JSeparator();
		springLayout.putConstraint(SpringLayout.WEST, separator_1, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator_1, -10, SpringLayout.EAST, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator, 0, SpringLayout.EAST, separator_1);
		springLayout.putConstraint(SpringLayout.NORTH, separator_1, 76, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator_1, 78, SpringLayout.NORTH, getContentPane());
		getContentPane().add(separator_1);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		springLayout.putConstraint(SpringLayout.NORTH, tabbedPane, 8, SpringLayout.SOUTH, separator_1);
		springLayout.putConstraint(SpringLayout.WEST, tabbedPane, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, tabbedPane, -6, SpringLayout.NORTH, separator);
		springLayout.putConstraint(SpringLayout.EAST, tabbedPane, -10, SpringLayout.EAST, getContentPane());
		getContentPane().add(tabbedPane);
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("MATERIAL SLIP", null, panel, null);
		SpringLayout sl_panel = new SpringLayout();
		panel.setLayout(sl_panel);
		
		JSeparator separator_2 = new JSeparator();
		sl_panel.putConstraint(SpringLayout.NORTH, separator_2, 0, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.SOUTH, separator_2, 0, SpringLayout.SOUTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, separator_2, 150, SpringLayout.WEST, panel);
		separator_2.setOrientation(SwingConstants.VERTICAL);
		panel.add(separator_2);
		
		JLabel lblItems = new JLabel("ITEMS:");
		sl_panel.putConstraint(SpringLayout.NORTH, lblItems, 30, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, lblItems, 10, SpringLayout.WEST, panel);
		panel.add(lblItems);
		
		JComboBox comboBox = new JComboBox();
		panel.add(comboBox);
		
		JLabel lblBldgNo = new JLabel("BLDG NO.:");
		sl_panel.putConstraint(SpringLayout.NORTH, lblBldgNo, 31, SpringLayout.SOUTH, lblItems);
		sl_panel.putConstraint(SpringLayout.WEST, lblBldgNo, 0, SpringLayout.WEST, lblItems);
		panel.add(lblBldgNo);
		
		JComboBox comboBox_1 = new JComboBox();
		sl_panel.putConstraint(SpringLayout.NORTH, comboBox_1, -3, SpringLayout.NORTH, lblItems);
		sl_panel.putConstraint(SpringLayout.WEST, comboBox_1, 0, SpringLayout.WEST, comboBox);
		
		panel.add(comboBox_1);
		
		JLabel lblFlatNo = new JLabel("FLAT NO.:");
		sl_panel.putConstraint(SpringLayout.NORTH, lblFlatNo, 36, SpringLayout.SOUTH, lblBldgNo);
		sl_panel.putConstraint(SpringLayout.WEST, lblFlatNo, 0, SpringLayout.WEST, lblItems);
		panel.add(lblFlatNo);
		
		JComboBox comboBox_2 = new JComboBox();
		sl_panel.putConstraint(SpringLayout.NORTH, comboBox_2, -3, SpringLayout.NORTH, lblBldgNo);
		sl_panel.putConstraint(SpringLayout.WEST, comboBox_2, 0, SpringLayout.WEST, comboBox);
		panel.add(comboBox_2);
		
		JButton btnAdd = new JButton("ADD");
		sl_panel.putConstraint(SpringLayout.WEST, btnAdd, 48, SpringLayout.WEST, panel);
		sl_panel.putConstraint(SpringLayout.SOUTH, btnAdd, -45, SpringLayout.SOUTH, panel);
		sl_panel.putConstraint(SpringLayout.EAST, btnAdd, 118, SpringLayout.WEST, panel);
		panel.add(btnAdd);
		
		JLabel lblRegQty = new JLabel("REG. QTY:");
		sl_panel.putConstraint(SpringLayout.NORTH, comboBox, -3, SpringLayout.NORTH, lblRegQty);
		sl_panel.putConstraint(SpringLayout.WEST, comboBox, 6, SpringLayout.EAST, lblRegQty);
		sl_panel.putConstraint(SpringLayout.NORTH, lblRegQty, 34, SpringLayout.SOUTH, lblFlatNo);
		sl_panel.putConstraint(SpringLayout.WEST, lblRegQty, 0, SpringLayout.WEST, lblItems);
		panel.add(lblRegQty);
		
		JScrollPane scrollPane = new JScrollPane();
		sl_panel.putConstraint(SpringLayout.NORTH, scrollPane, 10, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, scrollPane, 16, SpringLayout.WEST, separator_2);
		sl_panel.putConstraint(SpringLayout.SOUTH, scrollPane, -11, SpringLayout.SOUTH, panel);
		sl_panel.putConstraint(SpringLayout.EAST, scrollPane, -32, SpringLayout.EAST, panel);
		panel.add(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"NO.", "ITEMS", "UNIT", "REQUIRED QTY"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		scrollPane.setViewportView(table);
		
		JComboBox comboBox_3 = new JComboBox();
		sl_panel.putConstraint(SpringLayout.NORTH, comboBox_3, 0, SpringLayout.NORTH, lblFlatNo);
		sl_panel.putConstraint(SpringLayout.WEST, comboBox_3, 0, SpringLayout.WEST, comboBox);
		panel.add(comboBox_3);
		
		JPanel panel_1 = new JPanel();
		tabbedPane.addTab("INDENT", null, panel_1, null);
		SpringLayout sl_panel_1 = new SpringLayout();
		panel_1.setLayout(sl_panel_1);
		
		JSeparator separator_3 = new JSeparator();
		
		separator_3.setOrientation(SwingConstants.VERTICAL);
		panel_1.add(separator_3);
		
		JLabel lblItemCode = new JLabel("ITEM CODE");
		sl_panel_1.putConstraint(SpringLayout.WEST, lblItemCode, 10, SpringLayout.WEST, panel_1);
		panel_1.add(lblItemCode);
		
		JComboBox comboBox_4 = new JComboBox();
		sl_panel_1.putConstraint(SpringLayout.WEST, separator_3, 55, SpringLayout.EAST, comboBox_4);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox_4, 52, SpringLayout.EAST, lblItemCode);
		sl_panel_1.putConstraint(SpringLayout.NORTH, comboBox_4, -3, SpringLayout.NORTH, lblItemCode);
		panel_1.add(comboBox_4);
		
		JLabel lblItemDescription = new JLabel("ITEM DESCRIPTION");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblItemDescription, 109, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, lblItemCode, -40, SpringLayout.NORTH, lblItemDescription);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblItemDescription, 0, SpringLayout.WEST, lblItemCode);
		panel_1.add(lblItemDescription);
		
		JComboBox comboBox_5 = new JComboBox();
		sl_panel_1.putConstraint(SpringLayout.NORTH, comboBox_5, 31, SpringLayout.SOUTH, comboBox_4);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox_5, 12, SpringLayout.EAST, lblItemDescription);
		
		panel_1.add(comboBox_5);
		
		JLabel lblRequirement = new JLabel("REQUIREMENT");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblRequirement, 38, SpringLayout.SOUTH, lblItemDescription);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblRequirement, 10, SpringLayout.WEST, panel_1);
		panel_1.add(lblRequirement);
		
		textField = new JTextField();
		sl_panel_1.putConstraint(SpringLayout.NORTH, textField, -3, SpringLayout.NORTH, lblRequirement);
		sl_panel_1.putConstraint(SpringLayout.WEST, textField, 35, SpringLayout.EAST, lblRequirement);
		sl_panel_1.putConstraint(SpringLayout.EAST, textField, -55, SpringLayout.WEST, separator_3);
		panel_1.add(textField);
		textField.setColumns(10);
		
		JButton btnAdd_1 = new JButton("ADD");
		sl_panel_1.putConstraint(SpringLayout.NORTH, btnAdd_1, 38, SpringLayout.SOUTH, textField);
		sl_panel_1.putConstraint(SpringLayout.WEST, btnAdd_1, 65, SpringLayout.WEST, panel_1);
		panel_1.add(btnAdd_1);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		sl_panel_1.putConstraint(SpringLayout.WEST, scrollPane_1, 226, SpringLayout.WEST, panel_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, scrollPane_1, -10, SpringLayout.EAST, panel_1);
		sl_panel_1.putConstraint(SpringLayout.NORTH, separator_3, 0, SpringLayout.NORTH, scrollPane_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, separator_3, -24, SpringLayout.WEST, scrollPane_1);
		sl_panel_1.putConstraint(SpringLayout.NORTH, scrollPane_1, 10, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, scrollPane_1, -10, SpringLayout.SOUTH, panel_1);
		panel_1.add(scrollPane_1);
		
		table_1 = new JTable();
		table_1.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"NO.", "ITEM CODE", "ITEM DESCRIPTION", "REQUIREMENT"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		scrollPane_1.setViewportView(table_1);
		
		JPanel panel_2 = new JPanel();
		tabbedPane.addTab("NOTIFICATIONS", null, panel_2, null);
	}
	/*
	 * ----------------------------------------------------------------------------
	 */
}
